﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage/AdminPage.master" AutoEventWireup="true" CodeFile="Feedback_Management.aspx.cs" Inherits="Admin_FeedbackManagement" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <table style="width: 100%;">
        <tr>
            <td style="height: 30px; background-image: url('../images/bg_head.png');" colspan="2" 
                class="style3">
                <asp:Label ID="Label2" runat="server" ForeColor="White" Text="Feedback Management" 
                    Font-Bold="True" ></asp:Label>
            </td>
        </tr>
        <tr>
            <td style="width: 26px">
            </td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td style="width: 26px">
            </td>
            <td align="center">
                <asp:GridView ID="gvFeedback" runat="server" AllowPaging="True" 
                    AutoGenerateColumns="False" CellPadding="4" CssClass="style3" 
                    DataKeyNames="FeedbackID" DataSourceID="SqlDataSource1" 
                    EmptyDataText="There are no data records to display." ForeColor="#333333" 
                    GridLines="None" Height="163px" onrowcommand="gvFeedback_RowCommand" 
                    Width="421px">
                    <AlternatingRowStyle BackColor="White" />
                    <Columns>
                        <asp:BoundField DataField="FeedbackID" HeaderText="FeedbackID" ReadOnly="True" 
                            SortExpression="FeedbackID" />
                        <asp:BoundField DataField="CustID" HeaderText="CustomerID" 
                            SortExpression="CustID" />
                        <asp:BoundField DataField="DateSent" HeaderText="DateSent" 
                            SortExpression="DateSent" />
                        <asp:TemplateField HeaderText="Command">
                            <ItemTemplate>
                                <asp:ImageButton ID="imgbAnswer" runat="server" 
                                    CommandArgument='<%# Eval("FeedbackID") %>' CommandName="Answer" 
                                    ImageUrl="~/images/img_Answer.png" />
                            </ItemTemplate>
                            <ControlStyle Height="25px" Width="75px" />
                        </asp:TemplateField>
                        <asp:CommandField ButtonType="Image" DeleteImageUrl="~/images/img_Delete.png" 
                            HeaderText="Delete" ShowDeleteButton="True">
                        <ControlStyle Height="25px" Width="75px" />
                        </asp:CommandField>
                    </Columns>
                    <EditRowStyle BackColor="#2461BF" />
                    <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                    <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                    <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                    <RowStyle BackColor="#EFF3FB" />
                    <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                    <SortedAscendingCellStyle BackColor="#F5F7FB" />
                    <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                    <SortedDescendingCellStyle BackColor="#E9EBEF" />
                    <SortedDescendingHeaderStyle BackColor="#4870BE" />
                </asp:GridView>
                <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:OPOConnectionString %>" 
                    DeleteCommand="DELETE FROM [Feedback] WHERE [FeedbackID] = @FeedbackID" 
                    InsertCommand="INSERT INTO [Feedback] ([CustID], [DateSent], [Title], [Content]) VALUES (@CustID, @DateSent, @Title, @Content)" 
                    ProviderName="<%$ ConnectionStrings:OPOConnectionString.ProviderName %>" 
                    SelectCommand="SELECT [FeedbackID], [CustID], [DateSent], [Title], [Content] FROM [Feedback]" 
                    UpdateCommand="UPDATE [Feedback] SET [CustID] = @CustID, [DateSent] = @DateSent, [Title] = @Title, [Content] = @Content WHERE [FeedbackID] = @FeedbackID">
                    <DeleteParameters>
                        <asp:Parameter Name="FeedbackID" Type="Int32" />
                    </DeleteParameters>
                    <InsertParameters>
                        <asp:Parameter Name="CustID" Type="Int32" />
                        <asp:Parameter Name="DateSent" Type="String" />
                        <asp:Parameter Name="Title" Type="String" />
                        <asp:Parameter Name="Content" Type="String" />
                    </InsertParameters>
                    <UpdateParameters>
                        <asp:Parameter Name="CustID" Type="Int32" />
                        <asp:Parameter Name="DateSent" Type="String" />
                        <asp:Parameter Name="Title" Type="String" />
                        <asp:Parameter Name="Content" Type="String" />
                        <asp:Parameter Name="FeedbackID" Type="Int32" />
                    </UpdateParameters>
                </asp:SqlDataSource>
            </td>
        </tr>
        <tr>
            <td style="width: 26px">
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
    </table>
</asp:Content>

